package exo3;

public class Employe {
	
	private String nomEmploye;
	private float salHoraireBase;
	private int nbHeureHebdo;

	/**
	 * @param nomEmploye
	 * @param salHoraireBase
	 * @param nbHeureHebdo
	 * @throws Exception 
	 */
	public Employe(String pNomEmploye, float pSalHoraireBase, int pNbHeureHebdo) throws Exception {
		if(pSalHoraireBase<13){
			throw new Exception("Heure de base en dessous de 13e");
		}
		else if(pNbHeureHebdo>60){
			throw new Exception("NB d'heure hebdo > 60");
		}
		else {
			this.nomEmploye = pNomEmploye;
			this.salHoraireBase = pSalHoraireBase;
			this.nbHeureHebdo = pNbHeureHebdo;
		}
	}

	public String getNomEmploye() {
		return nomEmploye;
	}
	
	public void setNomEmploye(String pNomEmploye) {
		this.nomEmploye = pNomEmploye;
	}
	
	public float getSalMoyen() {
		return salHoraireBase;
	}
	
	public void setSalMoyen(float pSalMoyen) {
		this.salHoraireBase = pSalMoyen;
	}
	
	public int getNbHeureHebdo() {
		return nbHeureHebdo;
	}
	
	public void setNbHeureHebdo(int pNbHeureHebdo) {
		this.nbHeureHebdo = pNbHeureHebdo;
	}

	public String toString() {
		return "Nom : " + nomEmploye + "\nSalaire Horaire de base : " + salHoraireBase + "\nNombre d'Heure Hebdomadaire : " + 
				nbHeureHebdo;
	}
	
}
